package com.yijianonghu.controller.app.general;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yijianonghu.util.Constants.AppConstants;
import com.yijianonghu.util.result.Result;

@Controller
@RequestMapping(method=RequestMethod.POST)
public class DistrictListController {

	/**
	 * [sys_web_service]district_list<br/>
	 * 
	 * @param parentId 父级主键id.	0：表示获取第一级别（省份或直辖市或自治区）, -1：表示获取所有地级以上级别城市（含地级）
	 * @return
	 * 
	 * infor:<br/>
	 * id			主键id	<br/>
	 * name			地区名称	<br/>
	 * parentid		父级别主键	<br/>
	 * nodepath		节点主键路径串	<br/>
	 * namepath		节点名称路径串	<br/>
	 * charindex	名称拼音首字母索引, 比如"北京"的charindex为"B"<br/>
	 * level		节点层级	<br/>
	 * orderby		排序优先级<br/>
	 * 
	 * 形如:<br/>
	 * { "success":true, "msg":"操作成功！", "infor":{ "totalCount":"1", "listItems":[ { "id":"2811", "name":"济源市", "parentid":"257", "nodepath":"0,16,257", "namepath":"河南省,济源市,济源市", "charindex":"J", "level":"3", "orderby":"1" } ] } }
	 */
	@RequestMapping(value=AppConstants.APP_PREFIX+AppConstants.APP_GENERAL_VERSION_REGX+"/district_list")
	public @ResponseBody Result listDistrict(Long parentId){
		//TODO 参数类型不明确，返回值不明确。
		return null;
	}
	
	/**
	 * [sys_web_service]district_all_get
	 * 
	 * @return
	 * infor:<br/>
	 * id			主键id	<br/>
	 * name			地区名称	<br/>
	 * parentid		父级别主键	<br/>
	 * nodepath		节点主键路径串	<br/>
	 * namepath		节点名称路径串	<br/>
	 * charindex	名称拼音首字母索引, 比如"北京"的charindex为"B"<br/>
	 * level		节点层级	<br/>
	 * orderby		排序优先级	<br/>
	 * 形如:<br/>
	 * { "success":true, "msg":"操作成功！", "infor":[ { "children":[ { "id":"1", "parentid":"0", "name":"北京市", "children":[ { "id":"37", "parentid":"1", "name":"东城区", "children":[ { "id":"567", "parentid":"37", "name":"东华门街道", "children":[ ] }, { "id":"568", "parentid":"37", "name":"东四街道", "children":[ ] }, { "id":"569", "parentid":"37", "name":"东直门街道", "children":[ ] }, ...
	 */
	@RequestMapping(value=AppConstants.APP_PREFIX+AppConstants.APP_GENERAL_VERSION_REGX+"/district_all_get")
	public @ResponseBody Result getAllDistrict(){
		//TODO 返回值不明确
		return null;
	}
}
